//
//  LYLYIntegrationCell.m
//  artist
//
//  Created by Jay_Apple on 16/5/4.
//  Copyright © 2016年 viviyoo. All rights reserved.
//

#import "LYLYIntegrationCell.h"
#import "LYMyIntegralListModel.h"
#import "NSDate+Utils.h"

@interface LYLYIntegrationCell ()

@property (weak, nonatomic) IBOutlet UILabel *title;


@property (weak, nonatomic) IBOutlet UILabel *time;
@property (weak, nonatomic) IBOutlet UILabel *integrationValue;

@end

@implementation LYLYIntegrationCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setModel:(LYMyIntegralListModel *)model{

    _model = model;
    
    self.title.text = _model.remark;
    
    NSDate *date = [NSDate dateFromTimeStampString:_model.create_time];
    self.time.text = [date string];
    
    NSString *integrationValueStr = nil;
    if ([_model.integral containsString:@"-"]) {
        integrationValueStr = _model.integral;
    }else{
    
        integrationValueStr = [NSString stringWithFormat:@"+%@",_model.integral];
    }
    
    self.integrationValue.text = integrationValueStr;
}

@end
